package com.ict.txmsv2.configures;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @Author lht
 * @date 2021/4/23 - 22:51
 * @description: swagger配置
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public Docket webApiConfig(){
        return new Docket(DocumentationType.OAS_30)
                //组名称
                .groupName("ICT")
                .apiInfo(webApiInfo())
                .select()
                //扫描的包
                .apis(RequestHandlerSelectors.basePackage("com.ict.txmsv2.controller"))
                .paths(PathSelectors.any())
                .build();

    }
    /**
     * 该套 API 说明，包含作者、简介、版本、等信息
     * @return
     */
    private ApiInfo webApiInfo(){
        return new ApiInfoBuilder()
                .title("ICT后台接口文档")
                .description("本文档描述了ICT接口定义")
                .version("1.0")
                .build();
    }

}
